#ifndef _COMMON
#define _COMMON

#include <vector>

#include <NTL/vec_ZZ.h>
#include <NTL/ZZ.h>
#include <NTL/RR.h>
#include <NTL/mat_ZZ.h>

#define RANDOM_MAX 10 * dimension


NTL_CLIENT

/*
 * vec is a structure that has a vec_ZZ and keeps track of its magnitude squared
 * so that we don't have to recalculate it for some optimization
 */
struct vec {
  vec_ZZ v;
  ZZ mag_sq;
};

//sets b to be the vec_ZZ of a
void setVec(vec *a, vec_ZZ &b);

//returns magnitude squared of a
ZZ mag_sq(vec_ZZ &a);

//returns min(v - c * a) over integers c
vec reduce(vec *v, vec *a);

#endif
